import request from '@/utils/request'

//提供调用注册接口的函数
export const customerRegisterService = (registerData: any) => {
    //利用URLSearchParams完成传递
    const params = new URLSearchParams();
    for(const key in registerData){
        params.append(key,registerData[key]);
    }
    return request.post('/Customer/register',params);
}

//提供调用登录接口的函数
export const customerLoginService = (registerData: any) => {
    //同样利用URLSearchParams完成传递
    const params = new URLSearchParams();
    for(const key in registerData) {
        params.append(key,registerData[key]);
    }
    return request.post('/Customer/login',params);
}

//提供调用注册接口的函数
export const businessRegisterService = (registerData: any) => {
    //利用URLSearchParams完成传递
    const params = new URLSearchParams();
    for(const key in registerData){
        params.append(key,registerData[key]);
    }
    return request.post('/Business/register',params);
}

//提供调用登录接口的函数
export const businessLoginService = (registerData: any) => {
    //同样利用URLSearchParams完成传递
    const params = new URLSearchParams();
    for(const key in registerData) {
        params.append(key,registerData[key]);
    }
    return request.post('/Business/login',params);
}